# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=ovos-skill-manager
pkgver=0.0.13a2
pkgrel=0
pkgdesc="Open Voice OS skill manager"
url="https://github.com/OpenVoiceOS/ovos_skill_manager"
arch="noarch"
license="Apache-2.0"
depends="
	ovos-skill-installer
	py3-beautifulsoup4
	py3-click
	py3-click-default-group
	py3-combo-lock
	py3-json-database
	py3-ovos-config
	py3-ovos-utils
	py3-packaging
	py3-pako
	py3-requests
	py3-requests-cache
	py3-yaml
	"
makedepends="
	py3-gpep517
	py3-setuptools
	py3-wheel
	"
checkdepends="py3-pytest"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/OpenVoiceOS/ovos_skill_manager/archive/refs/tags/V$pkgver.tar.gz"
# net required for tests
options="net"
builddir="$srcdir/ovos_skill_manager-$pkgver"

# Backwards compatibility from a rename
provides="ovos-skills-manager=$pkgver-r$pkgrel"
replaces="ovos-skills-manager"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest -k 'not test_locate_config' \
		--deselect test/unittests/test_osm.py
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
11f289fe4219198ef40a05fe3e152aeef8e226a96ec762b7caf53aed2270f62727505930a76092ccfecb75826bed2a55db87f81235f0f433f060fbe7e0f431eb  ovos-skill-manager-0.0.13a2.tar.gz
"
